package com.tedu.review.day02;

/**
 * instanceof关键字
 *
 */
class Name{ }
class ReName extends Name{ }
public class instanceof关键字 {
    public static void main(String[] args) {
        Name name=new Name(); //没有造型；没有多态性 创建类
        System.out.println(name instanceof Name); //true
        System.out.println(name instanceof ReName);//false
        Name n=new ReName();            //向上造型，具备多态 创建类
        System.out.println(n instanceof ReName);
        System.out.println(n instanceof ReName);

    }
}
